<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>爱上电视C1系统</title>
	<link rel="stylesheet" href="css/c1.css">
	<link rel="stylesheet" href="css/editPassword.css">
	<script src="js/jquery.js"></script>
	<script src="js/layer/layer.js"></script>
	<script src="js/c1.js"></script>
</head>
<body>
	<div class="header">
		<div class="header_one">
			<p>欢迎您：您当前所在的位置：爱上电视C1系统</p>
		</div>
		<div class="header_two">
			<ul id="tabs_one">
				<li class="tab-nav l"><a href="update.jsp">模板下发</a></li>
				<li class="tab-nav l"><a href="fileDelete.jsp">文件删除</a></li>
				<li class="tab-nav l"><a href="record.jsp?page=1">日志</a></li>
				<li class="tab-nav r">
				<a href="${pageContext.request.contextPath}/LogoutServlet"><span ><img src="img/loginout.jpg" alt="loginout"
				class="login-out">退出</span></a></li>
				<li class="tab-nav-action r" style = "${sessionScope.user.username=='adminstrator'?'':'visibility:hidden'} ;">
				<a href="${pageContext.request.contextPath}/editPassword.jsp"><span><img src="img/modify.jpg" alt="modify"  class="modify-message">修改密码</span></a>
				</li>
			</ul>
		</div>
	</div>
	<div class="editPassword_main">
		<h2>爱上电视C1系统</h2>
		<div class="show">
			<h3>修改普通用户的密码</h3>
			<div class="modify">
				<div class="oldPassword">
					<label for="oldPassword">当前密码：</label>
					<br>
					<input type="password" id="oldPassword" value="">
				</div>
				<div class="newPassword">
					<label for="newPassword">新密码(字母,符号或数字,至少8个字符)：</label>
					<br>
					<input type="password" id="newPassword" value="">
				</div>
				<div class="confirmPassword">
					<label for="confirmPassword">确认新密码：</label>
					<br>
					<input type="password" id="confirmPassword" value="">
					
				</div>
				<div class="subModify">
					<button class="mdf_psd" value="changePsd" id="mdf_psd">确认修改密码</button>
				</div>
			</div>
			<div class="message">
				<h4>如何使密码更安全？</h4>
				<p class="message_show">使用标点符号，数字和大小写字母的组合作为密码。<br>密码中勿包含个人信息（如姓名、生日等）<br>不使用和其他网站相同的密码。<br>定期修改密码。</p>
			</div>
		</div>
	</div>
	<div class="footer">
		<p>Copyrighto 2015,China IPTV Co.,Ltd.ALLRights Reserved</p>
	</div>
	<script>
		$(function(){
			$('#mdf_psd').on('click', function(){  
				var oldPassword = $('#oldPassword').val();
				var newPassword = $('#newPassword').val();
				var confirmPassword = $('#confirmPassword').val();
				if(newPassword != confirmPassword ){
					alert("输入的密码不一致");
					return;
				}
				$.ajax({
					url:'/COneClient/changePasswordServlet',
					data:{
						oldPassword:oldPassword,
						newPassword:newPassword
					},
					type:'get',
					success:function(data){
		
						if(data==1)
							resStr="修改成功";
						else 
							resStr="修改失败";
							
						layer.msg(resStr,{
							time:1000
						});
					},
					error:function(data){
						layer.msg("修改失败",{
							time:1000
						});
					}
				})
			});  
		})
	</script>
</body>
</html>